// ==========================================================================
// GFast自动生成model操作代码。
// 生成日期：2024-01-05 17:57:11
// 生成路径: internal/app/flow/model/flow_model.go
// 生成人：gfast
// desc:流程模型
// company:云南奇讯科技有限公司
// ==========================================================================

package model

import (
	"github.com/gogf/gf/v2/os/gtime"
	"github.com/gogf/gf/v2/util/gmeta"
	comModel "github.com/tiger1103/gfast/v3/internal/app/common/model"
	systemModel "github.com/tiger1103/gfast/v3/internal/app/system/model"
)

// FlowModelInfoRes is the golang structure for table flow_model.
type FlowModelInfoRes struct {
	gmeta.Meta         `orm:"table:flow_model"`
	Id                 uint64                   `orm:"id,primary" json:"id" dc:"主键"`                   // 主键
	Name               string                   `orm:"name" json:"name" dc:"流程名称"`                     // 流程名称
	FlowType           int                      `orm:"flow_type" json:"flowType" dc:"表单类型"`            // 表单类型
	FlowFormCate       int64                    `orm:"flow_form_cate" json:"flowFormCate" dc:"流程表单类别"` // 流程表单类别
	LinkedFlowFormCate *LinkedFlowModelFlowForm `orm:"with:id=flow_form_cate" json:"linkedFlowFormCate"`
	Remark             string                   `orm:"remark" json:"remark" dc:"流程描述"`                         // 流程描述
	FlowBusinessCate   string                   `orm:"flow_business_cate" json:"flowBusinessCate" dc:"业务表单类别"` // 业务表单类别
	Sort               int64                    `orm:"sort" json:"sort" dc:"排序"`                               // 排序
	Status             int                      `orm:"status" json:"status" dc:"流程状态"`                         // 流程状态
	CreatedAt          *gtime.Time              `orm:"created_at" json:"createdAt" dc:"创建时间"`                  // 创建时间
	UpdatedAt          *gtime.Time              `orm:"updated_at" json:"updatedAt" dc:"修改时间"`                  // 修改时间
	DeletedAt          *gtime.Time              `orm:"deleted_at" json:"deletedAt" dc:"删除时间"`                  // 删除时间
	CreatedBy          uint64                   `orm:"created_by" json:"createdBy" dc:"创建人"`                   // 创建人
	CreatedUser        *systemModel.LinkUserRes `orm:"with:id=created_by" json:"createdUser"`
	UpdatedBy          uint64                   `orm:"updated_by" json:"updatedBy" dc:"修改人"` // 修改人
	UpdatedUser        *systemModel.LinkUserRes `orm:"with:id=updated_by" json:"updatedUser"`
}
type LinkedFlowModelFlowForm struct {
	gmeta.Meta `orm:"table:flow_form"`
	Id         uint64 `orm:"id" json:"id" dc:"主键"`      // 主键
	Name       string `orm:"name" json:"name" dc:"表单名"` // 表单名
}

type FlowModelListRes struct {
	Id                 uint64                   `json:"id" dc:"主键"`
	Name               string                   `json:"name" dc:"流程名称"`
	FlowType           int                      `json:"flowType" dc:"表单类型"`
	FlowFormCate       int64                    `json:"flowFormCate" dc:"流程表单类别"`
	LinkedFlowFormCate *LinkedFlowModelFlowForm `orm:"with:id=flow_form_cate" json:"linkedFlowFormCate" dc:"流程表单类别"`
	FlowBusinessCate   string                   `json:"flowBusinessCate" dc:"业务表单类别"`
	Status             int                      `json:"status" dc:"流程状态"`
	CreatedAt          *gtime.Time              `json:"createdAt" dc:"创建时间"`
	CreatedUser        *systemModel.LinkUserRes `orm:"with:id=created_by" json:"createdUser"`
	CreatedBy          uint64                   `json:"createdBy" dc:"创建人"`
}

// FlowModelSearchReq 分页请求参数
type FlowModelSearchReq struct {
	comModel.PageReq
	Name             string `p:"name" dc:"流程名称"`                                               //流程名称
	FlowType         string `p:"flowType" v:"flowType@integer#表单类型需为整数" dc:"表单类型"`             //表单类型
	FlowFormCate     string `p:"flowFormCate" v:"flowFormCate@integer#流程表单类别需为整数" dc:"流程表单类别"` //流程表单类别
	FlowBusinessCate string `p:"flowBusinessCate" dc:"业务表单类别"`                                 //业务表单类别
	Sort             string `p:"sort" v:"sort@integer#排序需为整数" dc:"排序"`                         //排序
	Status           string `p:"status" v:"status@integer#流程状态需为整数" dc:"流程状态"`                 //流程状态
}

// FlowModelSearchRes 列表返回结果
type FlowModelSearchRes struct {
	comModel.ListRes
	List []*FlowModelListRes `json:"list"`
}

// 相关连表查询数据
type LinkedFlowModelDataSearchRes struct {
	LinkedFlowModelFlowForm []*LinkedFlowModelFlowForm `json:"linkedFlowModelFlowForm"`
}

// FlowModelAddReq 添加操作请求参数
type FlowModelAddReq struct {
	Name             string `p:"name" v:"required#流程名称不能为空" dc:"流程名称"`
	FlowType         int    `p:"flowType"  dc:"表单类型"`
	FlowFormCate     int64  `p:"flowFormCate"  dc:"流程表单类别"`
	Remark           string `p:"remark"  dc:"流程描述"`
	FlowBusinessCate string `p:"flowBusinessCate"  dc:"业务表单类别"`
	Sort             int64  `p:"sort"  dc:"排序"`
	Status           int    `p:"status" v:"required#流程状态不能为空" dc:"流程状态"`
	CreatedBy        uint64
}

// FlowModelEditReq 修改操作请求参数
type FlowModelEditReq struct {
	Id               uint64 `p:"id" v:"required#主键ID不能为空" dc:"主键"`
	Name             string `p:"name" v:"required#流程名称不能为空" dc:"流程名称"`
	FlowType         int    `p:"flowType"  dc:"表单类型"`
	FlowFormCate     int64  `p:"flowFormCate"  dc:"流程表单类别"`
	Remark           string `p:"remark"  dc:"流程描述"`
	FlowBusinessCate string `p:"flowBusinessCate"  dc:"业务表单类别"`
	Sort             int64  `p:"sort"  dc:"排序"`
	Status           int    `p:"status" v:"required#流程状态不能为空" dc:"流程状态"`
	UpdatedBy        uint64
}
